package com.yunyi.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yunyi.system.domain.TempType;
import com.yunyi.system.service.TempTypeService;
import com.yunyi.system.mapper.TempTypeMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * temp_type 模板类别 servie实现
 */
@Service
public class TempTypeServiceImpl extends ServiceImpl<TempTypeMapper, TempType>
    implements TempTypeService{

    @Autowired
    private TempTypeMapper tempTypeMapper;

    @Override
    public List<TempType> selectTTypeQuery(TempType tempType) {
        return tempTypeMapper.selectTTypeQuery(tempType);
    }

    /**
     * 根据id珊瑚
     * @param id
     * @return
     */
    @Override
    public TempType selectTTYpeById(Long id) {
        return tempTypeMapper.selectById(id);
    }

    @Override
    public int insertType(TempType tempType) {
        return tempTypeMapper.insert( tempType);
    }

    @Override
    public int updateTType(TempType tempType) {
        return tempTypeMapper.updateTType(tempType);
    }

    /**
     * 根据id删除模板类型信息
     * @param id
     * @return
     */
    @Override
    public int deleteTTypeById(Long id) {
        return tempTypeMapper.deleteById(id);
    }

    @Override
    public void deleteTTypeByIds(Long[] ids){
        for (Long id : ids) {
            deleteTTypeById(id);

        }
    }
}




